'use strict';

import VueRouter from "vue-router";
import HelloWorld from "@/components/HelloWorld";
import PayConfirm from "@/components/PayConfirm";
import OrderDisplay from "@/components/OrderDisplay";

const routes = [
    {
        path: '/',
        component: HelloWorld,
    },
    {
        path: '/confirm',
        component: PayConfirm,
        props: route => ({
            id: route.query.id,
            description: route.query.description,
            amount: route.query.amount,
            redirect: route.query.redirect,
        }),
    },
    {
        path: '/order',
        component: OrderDisplay,
        props: route => ({
            id: route.query.id,
            redirect: route.query.redirect,
        }),
    }
];

const router = new VueRouter({
    routes,
});

export default router;
